<template>
  <div id="teacher">
    <div class="main">
      <Row>
        <!-- 大标题 -->
        <Col span="24" class="maxTitle">{{teacherinfo.maxTitle}}</Col>
      </Row>
      <!-- 教师卡片循环 -->
      <Row v-for="(teacher,index) in teacherinfo.teachers" :key="index">
        <Col span="1">&nbsp;</Col>
        <Col span="22">
        <!-- 卡片 -->
          <Card class="card">
            <div style="text-align:center">
              <!-- 头像 -->
              <Avatar icon="ios-person" :src="teacher.avatar" size="66" class="avatar" />
              <!-- 名字 -->
              <h3 class="name">{{teacher.name}}</h3>
            </div>
            <Row>
              <Col span="24" class="description">
              <!-- 内容描述 -->
                <p>{{teacher.desc}}</p>
              </Col>
            </Row>
            <Row>
              <Col span="24" class="item">
              <!-- 序号内容 -->
                <p v-for="(item,index) in teacher.items" :key="index">{{item}}</p>
              </Col>
            </Row>
          </Card>
        </Col>
        <Col span="1">&nbsp;</Col>
      </Row>
    </div>
  </div>
</template>

<script>
//导入iview-ui组件 Avatar头像  Card卡片
import { Row, Col, Avatar, Card } from "view-design";

export default {
  name: "teacher",
  //组件注册
  components: {
    Row,
    Col,
    Avatar,
    Card
  },
  //传入属性
  props:['teacherinfo'],
  data() {
    return {
      
    };
  },
  computed: {},
  watch: {},
  methods: {},
  created() {},
  mounted() {},
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>

<style scoped>
/* 局部UI样式修改 */
.main {
  text-align: center;
}
.maxTitle {
  font-size: 20px;
  margin: 20px auto;
}
.card {
  width: 100%;
  box-shadow: 0 2px 10px 0 #e2e5e888;
  margin: 15px 0;
  padding: 0 20px 20px;
}
.avatar {
  margin: 20px 0;
}
.name {
  color: #a9adb1;
  margin-bottom: 30px;
}
.description {
  line-height: 24px;
}
.item {
  text-align: left;
  line-height: 24px;
}
</style>